package com.jcfy.project.module.service.impl;

import java.util.List;
import com.jcfy.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.jcfy.project.module.mapper.TAccountDetailMapper;
import com.jcfy.project.module.domain.TAccountDetail;
import com.jcfy.project.module.service.ITAccountDetailService;

/**
 * 账户收支明细Service业务层处理
 *
 * @author jiangfeng
 * @date 2020-08-05
 */
@Service
public class TAccountDetailServiceImpl implements ITAccountDetailService {
    @Autowired
    private TAccountDetailMapper tAccountDetailMapper;

    /**
     * 查询账户收支明细
     *
     * @param adId 账户收支明细ID
     * @return 账户收支明细
     */
    @Override
    public TAccountDetail selectTAccountDetailById(Long adId) {
        return tAccountDetailMapper.selectTAccountDetailById(adId);
    }

    /**
     * 查询账户收支明细列表
     *
     * @param tAccountDetail 账户收支明细
     * @return 账户收支明细
     */
    @Override
    public List<TAccountDetail> selectTAccountDetailList(TAccountDetail tAccountDetail) {
        return tAccountDetailMapper.selectTAccountDetailList(tAccountDetail);
    }

    /**
     * 新增账户收支明细
     *
     * @param tAccountDetail 账户收支明细
     * @return 结果
     */
    @Override
    public int insertTAccountDetail(TAccountDetail tAccountDetail) {
        tAccountDetail.setCreateTime(DateUtils.getNowDate());
        return tAccountDetailMapper.insertTAccountDetail(tAccountDetail);
    }

    /**
     * 修改账户收支明细
     *
     * @param tAccountDetail 账户收支明细
     * @return 结果
     */
    @Override
    public int updateTAccountDetail(TAccountDetail tAccountDetail) {
        tAccountDetail.setUpdateTime(DateUtils.getNowDate());
        return tAccountDetailMapper.updateTAccountDetail(tAccountDetail);
    }

    /**
     * 批量删除账户收支明细
     *
     * @param adIds 需要删除的账户收支明细ID
     * @return 结果
     */
    @Override
    public int deleteTAccountDetailByIds(Long[] adIds) {
        return tAccountDetailMapper.deleteTAccountDetailByIds(adIds);
    }

    /**
     * 删除账户收支明细信息
     *
     * @param adId 账户收支明细ID
     * @return 结果
     */
    @Override
    public int deleteTAccountDetailById(Long adId) {
        return tAccountDetailMapper.deleteTAccountDetailById(adId);
    }
}
